#include "widget.h"
#include "ui_widget.h"
#include <QLineEdit>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->lineEdit_name->setPlaceholderText("请输入姓名");//设置当没有输入信息时显示的淡淡的提示内容
    ui->lineEdit_passward->setPlaceholderText("请输入密码");
    ui->lineEdit_telephone->setPlaceholderText("请输入电话");

    ui->lineEdit_passward->setEchoMode(QLineEdit::Password);//设置输入内容的显示形式

    ui->lineEdit_name->setClearButtonEnabled(true);//设置清除内容按钮
    ui->lineEdit_passward->setClearButtonEnabled(true);
    ui->lineEdit_telephone->setClearButtonEnabled(true);

    ui->lineEdit_telephone->setInputMask("000-0000-0000");

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    QString sex=ui->radioButton_male->isChecked()?"男":"女";


    qDebug()<<"姓名:"<<ui->lineEdit_name->text();
    qDebug()<<"密码:"<<ui->lineEdit_passward->text();
    qDebug()<<"性别:"<<sex;
    qDebug()<<"电话:"<<ui->lineEdit_telephone->text();

}


